#!/bin/sh

docker pull gcr.io/google_containers/kube-proxy:v1.15.7
docker pull gcr.io/google_containers/kube-apiserver:v1.15.7
docker pull gcr.io/google_containers/kube-scheduler:v1.15.7
docker pull gcr.io/google_containers/kube-controller-manager:v1.15.7
docker pull gcr.io/google_containers/coredns:1.3.1
docker pull kubernetesui/dashboard:v2.0.0-beta6
docker pull kubernetesui/metrics-scraper:v1.0.2
docker pull gcr.io/google_containers/etcd:3.3.15-0
docker pull gcr.io/google_containers/metrics-server-amd64:v0.3.6
docker pull quay.io/coreos/flannel:v0.10.0-amd64
docker pull gcr.io/google_containers/pause:3.1
docker pull nginx:1.15.12
docker pull gcr.io/kubernetes-helm/tiller:v2.13.1
docker pull quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1

docker tag gcr.io/google_containers/kube-proxy:v1.15.7 gcr.azk8s.cn/google_containers/kube-proxy:v1.15.7
docker tag gcr.io/google_containers/kube-apiserver:v1.15.7 gcr.azk8s.cn/google_containers/kube-apiserver:v1.15.7
docker tag gcr.io/google_containers/kube-scheduler:v1.15.7 gcr.azk8s.cn/google_containers/kube-scheduler:v1.15.7
docker tag gcr.io/google_containers/kube-controller-manager:v1.15.7 gcr.azk8s.cn/google_containers/kube-controller-manager:v1.15.7
docker tag gcr.io/google_containers/coredns:1.3.1 gcr.azk8s.cn/google_containers/coredns:1.3.1
docker tag kubernetesui/dashboard:v2.0.0-beta6 dockerhub.azk8s.cn/kubernetesui/dashboard:v2.0.0-beta8
docker tag kubernetesui/metrics-scraper:v1.0.2 dockerhub.azk8s.cn/kubernetesui/metrics-scraper:v1.0.2
docker tag gcr.io/google_containers/etcd:3.3.15-0 gcr.azk8s.cn/google_containers/etcd:3.3.15-0
docker tag gcr.io/google_containers/metrics-server-amd64:v0.3.6 gcr.azk8s.cn/google_containers/metrics-server-amd64:v0.3.6
docker tag quay.io/coreos/flannel:v0.10.0-amd64 quay.azk8s.cn/coreos/flannel:v0.11.0-amd64
docker tag gcr.io/google_containers/pause:3.1 gcr.azk8s.cn/google_containers/pause:3.1
docker tag nginx:1.15.12 dockerhub.azk8s.cn/library/nginx:1.17.5-alpine
docker tag gcr.io/kubernetes-helm/tiller:v2.13.1 gcr.azk8s.cn/kubernetes-helm/tiller:v2.13.1
docker tag quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1 quay.azk8s.cn/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1

docker save \
    gcr.azk8s.cn/google_containers/kube-proxy:v1.15.7 \
    gcr.azk8s.cn/google_containers/kube-apiserver:v1.15.7 \
    gcr.azk8s.cn/google_containers/kube-scheduler:v1.15.7 \
    gcr.azk8s.cn/google_containers/kube-controller-manager:v1.15.7 \
    gcr.azk8s.cn/google_containers/coredns:1.3.1 \
    dockerhub.azk8s.cn/kubernetesui/dashboard:v2.0.0-beta8 \
    dockerhub.azk8s.cn/kubernetesui/metrics-scraper:v1.0.2 \
    gcr.azk8s.cn/google_containers/etcd:3.3.15-0 \
    gcr.azk8s.cn/google_containers/metrics-server-amd64:v0.3.6 \
    gcr.azk8s.cn/google_containers/pause:3.1 \
    gcr.azk8s.cn/kubernetes-helm/tiller:v2.13.1 \
    dockerhub.azk8s.cn/library/nginx:1.17.5-alpine \
    quay.azk8s.cn/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1 \
    quay.azk8s.cn/coreos/flannel:v0.11.0-amd64 | gzip -1 > kubernetes-1.15.7.tar